#ifndef VASMWIDGET_H
#define VASMWIDGET_H

#include "VScintillaBase.h"
#include "Qsci/qscilexercpp.h"
#include "VAsmLexer.h"

class VAsmWidget : public VScintillaBase
{
    Q_OBJECT
public:
    VAsmWidget(QWidget *parent = nullptr);
    struct StyleData{
        int fore;
        int back;
        bool bold;
        bool italic;
    };

    VAsmLexer _lexer;
    QMap<int ,int> _addr_map;
    QMap<QString, StyleData> _style_map;
    int _pc_line = -1;
    void init_setting();
    void init_color();
    void setText(const QString &text);
    void set_addr_map(QMap<int ,int> map);
    void set_current_addr(int addr);

private:
    void init_connect();
    void init_option();
    void on_marginClicked(int margin, int line);

signals:
    void signal_set_breakpoint(int addr);
    void signal_disable_breakpint(int addr);
    void signal_enable_breakpoint(int addr);
    void signal_kill_breakpoint(int addr);
};

#endif // VASMWIDGET_H
